package com.example.physicalexaminationsystem.controller;

import com.example.physicalexaminationsystem.dto.ResponseDto;
import com.example.physicalexaminationsystem.service.ExamineService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author shiwenzhuo
 * 
 * @description
 */
@RestController
@RequestMapping("/api/examineReport")
public class ExamineReportController {
    @Resource
    private ExamineService examineService;

    //通过体检人姓名获取体检报告
    @RequestMapping("/getExamineReportByName")
    public ResponseDto getExamineReportByName(@RequestParam String name) {
        return ResponseDto.success(examineService.getExamineReportByName(name));
    }

    //填写基础体检报告
    @RequestMapping("/addNormalExamineReport")
    public ResponseDto addBasicExamineReport(@RequestBody Map<String, Object> params) {
        examineService.addNormalExamine(params);
        return ResponseDto.success();
    }

    //填写特殊体检报告
    @RequestMapping("/addSpecialExamineReport")
    public ResponseDto addSpecialExamineReport(@RequestBody Map<String, Object> params) {
        return examineService.addSpecialExamine(params);
    }

    //主检医师填写建议审核
    @RequestMapping("/addSuggestion")
    public ResponseDto addSuggestion(@RequestBody Map<String, Object> params) {
        return examineService.addSuggest(params);
    }
}
